﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Liberty.Tests.DomainTests
{
    public static class IEnumerableExtensions
    {
        public static int Count( this IEnumerable self )
        {
            if( self is ICollection )
            {
                return ( (ICollection)self ).Count;
            }
            else
            {
                throw new NotSupportedException( "Underlying collection is not 'countable'." );
            }
        }
    }
}
